package com.wjm.blog.common.base.response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * @Description: 返回结果公共类
 * @Author: Ailos
 * @Date: 2020/4/20 13:52
 * @Version: 1.0
 */
@ApiModel
public class PageResult<T> {
    @ApiModelProperty(value = "每页显示记录数")
    private long size = 10;

    @ApiModelProperty(value = "当前页")
    private long current = 1;

    @ApiModelProperty(value = "总页数")
    private long pages;

    @ApiModelProperty(value = "总记录数")
    private long total;

    @ApiModelProperty(value = "数据集合")
    private List<T> records;

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public long getCurrent() {
        return current;
    }

    public void setCurrent(long current) {
        this.current = current;
    }

    public long getPages() {
        return pages;
    }

    public void setPages(long pages) {
        this.pages = pages;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    @Override
    public String toString() {
        return "PageResult{" +
                "size=" + size +
                ", current=" + current +
                ", pages=" + pages +
                ", total=" + total +
                ", records=" + records +
                '}';
    }
}
